<?php
/**
 * Created by 项目.
 * User: xuguopeng
 * Date: 2020-06-11
 * Time: 09:20
 * 酒店房间表
 */

namespace app\api\model;


use think\model\concern\SoftDelete;

class HotelRoom extends BaseModel
{
    // 隐藏字段
    protected $hidden = [
        'admin_id',
        'lin_user_id',
        'order_sort',
        'recommend',
        'province_id',
        'city_id',
        'county_id',
        'create_time',
        'update_time',
        'delete_time',
    ];


    use SoftDelete;

    // 属于哪个酒店
    public function admin()
    {
        return $this->belongsTo('admin','admin_id');
    }

    // 图片列表
    public function imgs()
    {
        return $this->hasMany('HotelRoomImage','hotel_room_id');
    }

    // 基础信息
    public function roomBasis()
    {
        return $this->hasMany('HotelRoomBasis','hotel_room_id');
    }

    // 标签
    public function roomTag()
    {
        return $this->hasMany('HotelRoomTag','hotel_room_id');
    }

    // 设施与服务
    public function roomFacility()
    {
        return $this->hasMany('HotelRoomFacility','hotel_room_id');
    }

    // 入住要求
    public function roomClaim()
    {
        return $this->hasMany('HotelRoomClaim','hotel_room_id');
    }
}